package com.luoshizhen.lease.web.app.service.impl;

import com.luoshizhen.lease.model.entity.LeaseTerm;
import com.luoshizhen.lease.web.app.mapper.LeaseTermMapper;
import com.luoshizhen.lease.web.app.service.LeaseTermService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author liubo
 * @description 针对表【lease_term(租期)】的数据库操作Service实现
 * @createDate 2023-07-26 11:12:39
 */
@Service
public class LeaseTermServiceImpl extends ServiceImpl<LeaseTermMapper, LeaseTerm>
        implements LeaseTermService {

    @Autowired
    private LeaseTermMapper leaseTermMapper;

    /**
     * 根据房间ID获取租赁条款列表
     *
     * 此方法覆盖了父类的方法，旨在为特定房间ID获取所有相关的租赁条款
     * 它利用了leaseTermMapper接口提供的数据库查询功能，专门针对房间ID进行查询
     *
     * @param id 房间的唯一标识符使用Long类型来存储房间ID
     * @return 返回一个LeaseTerm对象列表，这些对象与给定房间ID关联如果没有找到关联的租赁条款，返回空列表
     */
    @Override
    public List<LeaseTerm> listByRoomId(Long id) {
        return leaseTermMapper.selectListByRoomId(id);
    }
}




